package com.sophon.pattern.delegate;

import java.util.HashMap;
import java.util.Map;

/**
 * 物管。用户委派快递给物管，物管根据用户要求去找到对应快递公司寄件<br/>
 * 快递公司必须要在物管处注册。
 * @author Andy G
 *
 */
public class PropertyManagement {

	private Map<String, LogisticsCompany2> logisticsCompanys;

	public PropertyManagement() {
		logisticsCompanys = new HashMap<String, LogisticsCompany2>(5);
	}

	public void putALogisticsCompany(String companyName, LogisticsCompany2 company) {
		this.logisticsCompanys.put(companyName, company);
	}

	public void sentByCompanyName(String companyName) {
		this.logisticsCompanys.get(companyName).ship();
	}
}
